<!doctype html>
<html>
<?php echo $this->fetch('head.html'); ?>
<style>
.none{display:none;}
</style>
<body>
 <div class="fullscreen">
  <div class="scroll_contentx">
    <div class="topfixed">
      <div class="t_left"><a href="/index.php"><i class="back"></i></a></div>
      <div class="t_main">选择楼栋</div>
      <div class="t_right"><a class="link" href="/index.php?m=sites"><?php echo $this->_var['site']['sitename']; ?></a></div>
    </div>
    <div class="paddingheight"></div>
    <div class="change_loudong">
    <div class="mainsort_box">
    	<ul class="mainsort">
          	<?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
              <li class="<?php if ($this->_var['k'] == 0): ?>cur<?php endif; ?> goTab" to="goTab<?php echo $this->_var['k']; ?>"><a href="JavaScript:;"><?php echo $this->_var['c']['title']; ?></a></li>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>  
               
            </ul>
            </div>
            <div class="subsort_box" style="position:inherit">
      <ul class="subsort">
          	<?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'cc');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['cc']):
?>
            <?php $_from = $this->_var['cc']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
            <?php if ($this->_var['c']['shopid']): ?>
            <li class="goTab<?php echo $this->_var['k']; ?> goTabLi <?php if ($this->_var['k'] != 0): ?>none<?php endif; ?>"><a href="/index.php?m=ymdian&id=<?php echo $this->_var['c']['shopid']; ?>"><span class="fr <?php if ($this->_var['c']['opentype'] == 'doing'): ?>green<?php else: ?>red<?php endif; ?>"><?php if ($this->_var['c']['opentype'] == 'doing'): ?>营业中<?php elseif ($this->_var['c']['opentype'] == 'close'): ?>升级中<?php else: ?>休息中<?php endif; ?></span><?php echo $this->_var['cc']['title']; ?> <span class="num"><?php echo $this->_var['c']['title']; ?></span></a></li>
            <?php else: ?>
            <li class="goTab<?php echo $this->_var['k']; ?> goTabLi <?php if ($this->_var['k'] != 0): ?>none<?php endif; ?>"><a href="javascript:openShop(<?php echo $this->_var['c']['sc_id']; ?>)"><span class="fr">申请开店</span><?php echo $this->_var['cc']['title']; ?> <span class="num"><?php echo $this->_var['c']['title']; ?></span></a></li>
             <?php endif; ?>
             <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
            <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 
            </ul>
    </div>
       
    </div>
  </div>
</div>
<div class="global_iframe" id="global_iframe">
  <div class="inner">
    <iframe src="/index.php?m=ymdian_apply" frameborder="0" scrolling="no" class="iframe" ></iframe>
  </div>
</div>
<div class="global_webmask"></div> 
<script>
$(document).on("click",".goTab",function(){
	var o=$(this);
	$(".goTab").removeClass("cur");
	$(this).addClass("cur");
	$(".goTabLi").addClass("none");
	$("."+o.attr("to")).removeClass("none");
});

//点击空白区域关闭弹窗
$(document).mouseup(function(e){
  var _con = $('.global_iframe ');   // 设置目标区域
  if(!_con.is(e.target) && _con.has(e.target).length === 0){
    _con.fadeOut('fast');
	$(".global_webmask").css("display","none");
  }
});
//开店弹窗
function openShop(id){
	$(".global_iframe .inner").html(' <iframe src="/index.php?m=ymdian_apply&sc_id='+id+'" frameborder="0" scrolling="no" class="iframe" ></iframe>');
	$(".global_iframe,.global_webmask").css("display","block");
}
function hidewin(){
	$(".global_iframe,.global_webmask").css("display","none");
}
</script>
 
</body>
</html>
